package vn.orderonline.core.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import vn.orderonline.core.dao.common.GenericDaoImpl;
import vn.orderonline.core.dao.entity.RestaurantMenuFood;
import vn.orderonline.core.dao.entity.RestaurantMenuFoodId;

@Repository
public class RestaurantMenuFoodDaoImpl extends
		GenericDaoImpl<RestaurantMenuFood, RestaurantMenuFoodId> implements
		RestaurantMenuFoodDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<RestaurantMenuFood> getListRestaurantMenuFoodByResId(
			Integer resId) {
		Criteria criteria = getSession().createCriteria(RestaurantMenuFood.class);
		criteria.add(Restrictions.eq("id.restaurantId", resId));
		return criteria.list();
	}

}
